mw.Api sets a default timeout of 30 seconds, meaning that if the
request takes more than that, it will be aborted. This is reasonable
in most cases, but file uploads can easily take longer than that.
Bug: T117545
Change-Id: I086108421d229c60f5e9d5c9edb70150d875dcb0
this[ this.needToken() ? 'postWithEditToken' : 'post' ]( data, {
// Use FormData (if we got here, we know that it's available)
contentType: 'multipart/form-data',
+ // No timeout (default from mw.Api is 30 seconds)
+ timeout: 0,
// Provide upload progress notifications
xhr: function () {
var xhr = $.ajaxSettings.xhr();